﻿{% extends "blogapp/base.html" %}
{% block content %}
    <!-- /主体 -->
    <div id="main-container" class="container clearfix">
        <section class="post-left">
            <div class="breadcrumb">您的位置： <a itemprop="breadcrumb" href="{% url 'blogapp:index' %}">首页</a> » <a
                    href="{% url 'blogapp:article_list' catecode %}">{{ this_artical.category.name }}</a> »
                <span class="current">正文</span>
                {% if messages %}
                    <span style="color: #FBA40F; float: right; font-weight: bold">
                        {% for msg in messages %}
                            {#                            alert('{{ msg.message }}');#}
                            {{ msg.message }}
                        {% endfor %}
                    </span>
                {% endif %}
            </div>
            <div class="post-main clearfix">
                <h1 class="post-title">{{ this_artical.title }}</h1>
                <div class="post-con clearfix">
                    <div class="article-meta">
                        <span class="item">分类：<a href="{% url 'blogapp:article_list' catecode %}"
                                                 rel="category tag">{{ this_artical.category.name }}</a></span>
                        <span class="item">作者：{{ this_artical.user }}</span>
                        <span class="item">浏览：{{ this_artical.views }}</span>
                        <span class="item">{{ this_artical.create_time|date:'Y年m月d日 H:i:s' }}</span>

                    </div>
                    <article class="article-content">
                        {{ this_artical.body|safe }}
                    </article>

                    <div class="post-tag"><span class="fa fa-tags" aria-hidden="true"></span>标签：
                        {% for tag in this_artical.tags.all %}
                            <a href="{% url 'blogapp:tag_article_list' tag.code %}" rel="tag">{{ tag.name }}</a>
                        {% endfor %}
                    </div>
                    <div>
                        <div><b>上一篇：</b>
                            {% if next_artical %}
                                <a href="{% url 'blogapp:article_detail' catecode next_artical.pk %}"
                                   class="article-tag">{{ next_artical }}</a>
                            {% else %}
                                没有了
                            {% endif %}
                        </div>
                        <div><b>下一篇：</b>
                            {% if pre_artical %}
                                <a href="{% url 'blogapp:article_detail' catecode pre_artical.pk %}"
                                   class="article-tag">{{ pre_artical }}</a>
                            {% else %}
                                没有了
                            {% endif %}
                        </div>
                    </div>
                </div>

            </div>
            <!-- /文章 -->


            <div class="recommend  hidden-xs">

                <div class="head clearfix"><span class="sp">您可能感兴趣的:</span></div>
                <ul>
                    {% for inte in interest_articals %}
                        <li>
                            <div class="pic">
                                <a href="{% url 'blogapp:article_detail' catecode inte.pk %}"
                                   title="{{ inte.title }}"><img
                                        src="{{ MEDIA_URL }}{{ inte.img }}"
                                        srcset="{{ MEDIA_URL }}{{ inte.img }}"
                                        alt="{{ inte.title }}" class="wp-post-image" width="145"
                                        height="100"/></a>
                            </div>
                            <a class="descript " href="{% url 'blogapp:article_detail' catecode inte.pk %}"
                               rel="bookmark"
                               title="{{ inte.title }}">{{ inte.title }}</a>
                        </li>
                    {% endfor %}
                </ul>
            </div>


        </section>
        <!-- /post-left -->
        <!-- /post-right -->
        <aside class="post-right hidden-xs">

            {% include 'blogapp/right.html' %}

        </aside>

    </div>
    <!-- /主体 -->
{% endblock %}
